# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=olm
pkgver=3.1.5
pkgrel=0
pkgdesc="Implementation of the olm and megolm cryptographic ratchets"
arch="all"
url="https://gitlab.matrix.org/matrix-org/olm"
license="Apache-2.0"
makedepends="cmake"
source="https://gitlab.matrix.org/matrix-org/olm/-/archive/$pkgver/olm-$pkgver.tar.gz"
subpackages="$pkgname-dev"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build/tests
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="2adb55cbed27f15db78a5ebd86ed78183a6d093e41b57d18cd8d046ceeb114993cf0b1c4f1a0e363aa9701cea580ec80797251db5f812fe088e3ea107f453563  olm-3.1.5.tar.gz"
